home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / dos / setowner.c < prev    next >
C/C++ Source or Header  |  1996-10-24  |  2KB  |  84 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: setowner.c,v 1.5 1996/10/24 15:50:37 aros Exp $
  4.     $Log: setowner.c,v $
  5.     Revision 1.5  1996/10/24 15:50:37  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/09/21 14:14:24  digulla
  9.     Hand DOSBase to DoName()
  10.  
  11.     Revision 1.3  1996/09/11 13:03:08  digulla
  12.     Wrote functions (M. Fleischer)
  13.  
  14.     Desc:
  15.     Lang: english
  16. */
  17. #include <clib/exec_protos.h>
  18. #include <dos/dosextens.h>
  19. #include <dos/filesystem.h>
  20. #include <clib/dos_protos.h>
  21. #include "dos_intern.h"
  22.  
  23. /*****************************************************************************
  24.  
  25.     NAME */
  26.     #include <clib/dos_protos.h>
  27.  
  28.     AROS_LH2(BOOL, SetOwner,
  29.  
  30. /*  SYNOPSIS */
  31.     AROS_LHA(STRPTR, name,       D1),
  32.     AROS_LHA(ULONG,  owner_info, D2),
  33.  
  34. /*  LOCATION */
  35.     struct DosLibrary *, DOSBase, 166, Dos)
  36.  
  37. /*  FUNCTION
  38.  
  39.     INPUTS
  40.     name       - name of the file
  41.     owner_info - (UID<<16)+GID
  42.  
  43.     RESULT
  44.     !=0 if all went well, 0 else. IoErr() gives additional
  45.     information in that case.
  46.  
  47.     NOTES
  48.  
  49.     EXAMPLE
  50.  
  51.     BUGS
  52.  
  53.     SEE ALSO
  54.  
  55.     INTERNALS
  56.  
  57.     HISTORY
  58.     29-10-95    digulla automatically created from
  59.                 dos_lib.fd and clib/dos_protos.h
  60.  
  61. *****************************************************************************/
  62. {
  63.     AROS_LIBFUNC_INIT
  64.     AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
  65.  
  66.     /* Get pointer to process structure */
  67.     struct Process *me=(struct Process *)FindTask(NULL);
  68.  
  69.     /* Get pointer to I/O request. Use stackspace for now. */
  70.     struct IOFileSys io,*iofs=&io;
  71.  
  72.     /* Prepare I/O request. */
  73.     iofs->IOFS.io_Message.mn_Node.ln_Type=NT_REPLYMSG;
  74.     iofs->IOFS.io_Message.mn_ReplyPort     =&me->pr_MsgPort;
  75.     iofs->IOFS.io_Message.mn_Length     =sizeof(struct IOFileSys);
  76.     iofs->IOFS.io_Flags=0;
  77.     iofs->IOFS.io_Command=FSA_SET_OWNER;
  78.     /* io_Args[0] is the name which is set by DoName(). */
  79.     iofs->io_Args[1]=owner_info>>16;
  80.     iofs->io_Args[2]=owner_info&0xffff;
  81.     return !DoName(iofs,name,DOSBase);
  82.     AROS_LIBFUNC_EXIT
  83. } /* SetOwner */
  84.